package com.ruoyi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum TaskType {
    //用户类型：0-正念练习，1-用药提醒，2-复查复诊，3-冥想
    Practice("0","正念练习"),
    Medication("1","用药提醒"),
    Review("2","患教"),
    Meditation("3","医生");

    private String value;
    private String name;

    public static TaskType valuesOf(String value) {
        //获取所有枚举集合
        TaskType[] es = values();
        for (TaskType e : es) {
            if (Objects.equals(e.getValue(), value)) {
                return e;
            }
        }
        return null;
    }
}
